﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities;

/// <summary>
/// 产品BOM关系表
/// </summary>
public class MdProductBom : Entity<int>
{
    /// <summary>
    /// 物料ID
    /// </summary>
    [Required]
    public long ItemId { get; set; }

    /// <summary>
    /// BOM物料ID
    /// </summary>
    [Required]
    public long BomItemId { get; set; }

    /// <summary>
    /// BOM物料编码
    /// </summary>
    [Required]
    [MaxLength(64)]
    public string BomItemCode { get; set; } = string.Empty;

    /// <summary>
    /// 代号
    /// </summary>
    [MaxLength(64)]
    public string BomCode { get; set; } = string.Empty;

    /// <summary>
    /// BOM物料名称
    /// </summary>
    [Required]
    [MaxLength(255)]
    public string BomItemName { get; set; } = string.Empty;

    /// <summary>
    /// BOM物料规格型号
    /// </summary>
    [MaxLength(500)]
    public string BomItemSpec { get; set; } = string.Empty;

    /// <summary>
    /// 物料产品标识（物料 item 产品 product）
    /// </summary>
    [Required]
    [MaxLength(20)]
    public string ItemOrProduct { get; set; } = string.Empty;

    /// <summary>
    /// 单位
    /// </summary>
    [Required]
    [MaxLength(64)]
    public string UnitOfMeasure { get; set; } = string.Empty;

    /// <summary>
    /// 生产类型（SELFMADE:自制件、OUTSOURCE:外购件、COOPERATION外协件、STANDARD标准件）
    /// </summary>
    [MaxLength(20)]
    public string ProductType { get; set; } = string.Empty;

    /// <summary>
    /// 使用比例
    /// </summary>
    [Required]
    public double QuantityRate { get; set; } = 0;

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(500)]
    public string Remark { get; set; } = string.Empty;

    /// <summary>
    /// 创建人
    /// </summary>
    [MaxLength(64)]
    public string? CreateBy { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    public DateTime? CreateTime { get; set; }

    /// <summary>
    /// 更新人
    /// </summary>
    [MaxLength(64)]
    public string? UpdateBy { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }
}

